home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK2.toast / Development Kits / USBDDK_v1.0.1_updated / Examples / USBSampleStorageDriver / SampleStorageDriverAPI.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-09-29  |  2.2 KB  |  104 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        StorageClassDriverAPI.c
  3.  
  4.     Contains:    xxx put contents here xxx
  5.  
  6.     Version:    xxx put version here xxx
  7.  
  8.     Copyright:    © 1998 by Apple Computer, Inc., all rights reserved.
  9.  
  10.  
  11. */
  12.  
  13.  
  14.  
  15. #include <Errors.h>
  16. #include "SampleStorageDriverAPI.h"
  17.  
  18. //
  19. // These functions are found in StorageClassDriver.c
  20. //
  21. extern OSStatus StorageClassDriverInitialize(void);
  22.  
  23. extern OSStatus StorageClassDriverControl(UInt32 theControlSelector, void *theControlData);
  24.  
  25. extern OSStatus StorageClassDriverStatus(UInt32 theInfoSelector, void *theInfo);
  26.  
  27. extern OSStatus StorageClassDriverBlockRead(StorageBlockRWPBPtr storageBlockRWPBPtr );
  28.  
  29. extern OSStatus StorageClassDriverBlockWrite(StorageBlockRWPBPtr storageBlockRWPBPtr );
  30.  
  31. extern OSStatus StorageClassDriverExecuteCommand(StorageExecuteCommandPBPtr storageExecuteCommandPBPtr);
  32.  
  33.  
  34.  
  35. OSStatus StorageInitialize(void)
  36. {
  37. OSStatus    status;
  38.  
  39.     status = StorageClassDriverInitialize();
  40.     
  41.     return status;
  42. }
  43.  
  44. OSStatus StorageControl(UInt32 theControlSelector, void * theControlData)
  45. {
  46. OSStatus    status;
  47.  
  48.     status = StorageClassDriverControl(theControlSelector, theControlData);
  49.  
  50.     return status;
  51. }
  52.  
  53. OSStatus StorageStatus(UInt32 theInfoSelector, void *theInfo)
  54. {
  55. #pragma unused (theInfoSelector, theInfo)
  56. OSStatus    status;
  57.  
  58.     status = StorageClassDriverStatus(theInfoSelector, theInfo);
  59.  
  60.     return status;
  61. }
  62.  
  63. #if 0
  64. OSStatus StorageBlockRead(StorageBlockRWPBPtr storageBlockRWPBPtr )
  65. {
  66. OSStatus    status;
  67.  
  68.     status = StorageClassDriverBlockRead(storageBlockRWPBPtr);
  69.     
  70.     return status;
  71. }
  72.  
  73. OSStatus StorageBlockWrite(StorageBlockRWPBPtr storageBlockRWPBPtr )
  74. {
  75. OSStatus    status;
  76.  
  77.     status = StorageClassDriverBlockWrite(storageBlockRWPBPtr);
  78.     
  79.     return status;
  80. }
  81. #endif
  82.  
  83. OSStatus StorageExecuteCommand(StorageExecuteCommandPBPtr storageExecuteCommandPBPtr)
  84. {
  85. OSStatus    status;
  86.  
  87.     status = StorageClassDriverExecuteCommand(storageExecuteCommandPBPtr);
  88.     
  89.     return status;
  90. }
  91.  
  92.  
  93.  
  94. StorageClassDispatchTable TheStorageClassDispatchTable =
  95. {
  96.     (UInt32)                        kDispatchTableVersion,
  97.     (StorageInitializeProcPtr)        StorageInitialize,
  98.     (StorageControlProcPtr)            StorageControl,
  99.     (StorageStatusProcPtr)            StorageStatus,
  100. //    (StorageBlockRWProcPtr)            StorageBlockRead,
  101. //    (StorageBlockRWProcPtr)            StorageBlockWrite,
  102.     (StorageExecuteCommandProcPtr)    StorageExecuteCommand
  103. };
  104.